<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});
Route::get('/hello', function () {
    return "hello";
});
Route::match(['get','post'],'text1',function(){
    return "通过match()访问";
});
Route::any('text2', function(){
    return "通过any方法访问";
});
Route::get('find2 /{id?}', function($id=0){
    return '输入的id为'.$id;
});
    
//重定向
Route::redirect('/hello','/');
//路由别名
Route::get('textad/adl',function(){
    return ('hello');
})->name('123');
//管理器后台页面
Route::group(['prefix'=>'admin'],function(){
    Route::get('/', function () {
        return "超级管理后台";
    });
Route::get('hello', function () {
        return "欢迎页面";
    });
    Route::get('login', function () {
        return "登录页面";
    });
});
Route::get('admin/testx1','Admin\TestController@testx1');
Route::get('text1/input','Admin\MyController@input');

// Route::get('admin/input','Admin\TestController@input');

Route::get('test/form','TestController@form');
Route::post('test/transfer','TestController@transfer');

// Route::get('test/profile','Controllers\TestController@profile');
// Route::post('test/store','Controllers\TestController@store')->name('store');

//cresf验证路由
Route::get('test/form','TestController@form')->middleware('test');
Route::post('test/transfer','TestController@transfer')->name('trans');

Route::get('test/profile','TestController@profile');
Route::post('test/store','Controllers\TestController@store')->name('store');
Route::get('testSession','TestController@testSession');

Route::group(['middleware'=>['test']],function(){
    Route::get('/',function(){
        return view('welcome');
    });
});
Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
